/*************************************************************************************
* 	 Copyright (C) 2010 by Information Systems Group, Saarland University  			*
*    http://infosys.cs.uni-saarland.de												*
* 	 																				*
* 	 This file is part of Hadoop++.												 	*
*																					*
*    Hadoop++ is free software: you can redistribute it and/or modify				*
*    it under the terms of the GNU Lesser General Public License as published by	*
*    the Free Software Foundation, either version 3 of the License, or				*
*    (at your option) any later version.											*
*																					*
*    Hadoop++ is distributed in the hope that it will be useful,					*
*    but WITHOUT ANY WARRANTY; without even the implied warranty of					*
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the					*
*    GNU Lesser General Public License for more details.							*
*																					*
*    You should have received a copy of the GNU Lesser General Public License		*
*    along with Hadoop++.  If not, see <http://www.gnu.org/licenses/>.				*
*************************************************************************************/
package tpc.benchmarks.joinOnCogroup;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileSplit;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter;

import unisb.cs.core.binary.reader.BinaryReaderInputFormat;

/**
 * This InputFormat class uses a RecordReader that sets the 
 * uservisit.sourceIP and rankings.pageRank+UV.adRevenue as 
 * <key, value> pairs.
 */
public class JoinTaskInputFormat extends BinaryReaderInputFormat {

	public static String SPLIT_SIZE = "splitSize";

	public static String IDX_RELATION = "idxrelation";
	public static String IDX_ATTR = "idxattr";
	public static String IDX_ATTR_SIZE = "idxattrsize";
	public static String IDX_ATTR_TYPE = "idxattrtype";

	@Override
	public RecordReader<Text, Text> getRecordReader(InputSplit split,
			JobConf job, Reporter reporter) throws IOException {
		return new JoinTaskRecordReader((FileSplit) split, job);
	}
}